home *** CD-ROM | disk | FTP | other *** search
-
-
-
- SSSSYYYYSSSSLLLLOOOOGGGG((((3333CCCC)))) SSSSYYYYSSSSLLLLOOOOGGGG((((3333CCCC))))
-
-
-
- NNNNAAAAMMMMEEEE
- syslog, openlog, closelog, setlogmask, vsyslog - control system log
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyysssslllloooogggg....hhhh>>>>
-
- vvvvooooiiiidddd ooooppppeeeennnnlllloooogggg((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****iiiiddddeeeennnntttt,,,, iiiinnnntttt llllooooggggoooopppptttt,,,, iiiinnnntttt ffffaaaacccciiiilllliiiittttyyyy))));;;;
-
- vvvvooooiiiidddd ssssyyyysssslllloooogggg((((iiiinnnntttt pppprrrriiiioooorrrriiiittttyyyy,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr ****mmmmeeeessssssssaaaaggggeeee,,,, _p_a_r_a_m_e_t_e_r_s...))));;;;
-
- vvvvooooiiiidddd cccclllloooosssseeeelllloooogggg((((vvvvooooiiiidddd))));;;;
-
- iiiinnnntttt sssseeeettttllllooooggggmmmmaaaasssskkkk((((iiiinnnntttt mmmmaaaasssskkkkpppprrrriiii))));;;;
-
- vvvvooooiiiidddd vvvvssssyyyysssslllloooogggg((((iiiinnnntttt pppprrrriiiioooorrrriiiittttyyyy,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr ****mmmmeeeessssssssaaaaggggeeee,,,, vvvvaaaa____lllliiiisssstttt aaaapppp))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- _S_y_s_l_o_g arranges to write _m_e_s_s_a_g_e onto the system log maintained by
- _s_y_s_l_o_g_d(1M). The message is tagged with _p_r_i_o_r_i_t_y. The message looks
- like a _p_r_i_n_t_f(3S) string except that %%%%mmmm is replaced by the current error
- message (collected from _e_r_r_n_o). A trailing newline is added if needed.
- This message will be read by _s_y_s_l_o_g_d(1M) and written to the system
- console, log files, or forwarded to _s_y_s_l_o_g_d on another host as
- appropriate. _V_s_y_s_l_o_g is like _s_y_s_l_o_g except that instead of being called
- with a variable number of arguments, it is called with an argument list
- as defined by _s_t_d_a_r_g(5).
-
- Priorities are encoded as a _f_a_c_i_l_i_t_y and a _l_e_v_e_l. The facility describes
- the part of the system generating the message. The level is selected
- from an ordered list:
-
- LOG_EMERG A panic condition. This is normally broadcast to all
- users.
-
- LOG_ALERT A condition that should be corrected immediately, such as a
- corrupted system database.
-
- LOG_CRIT Critical conditions, e.g., hard device errors.
-
- LOG_ERR Errors.
-
- LOG_WARNING Warning messages.
-
- LOG_NOTICE Conditions that are not error conditions, but should
- possibly be handled specially.
-
- LOG_INFO Informational messages.
-
- LOG_DEBUG Messages that contain information normally of use only when
- debugging a program.
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- SSSSYYYYSSSSLLLLOOOOGGGG((((3333CCCC)))) SSSSYYYYSSSSLLLLOOOOGGGG((((3333CCCC))))
-
-
-
- If _s_y_s_l_o_g cannot pass the message to _s_y_s_l_o_g_d, it will attempt to write
- the message on /_d_e_v/_c_o_n_s_o_l_e if the LOG_CONS option is set (see below).
-
- If special processing is needed, _o_p_e_n_l_o_g can be called to initialize the
- log file. The parameter _i_d_e_n_t is a string that is prepended to every
- message. _L_o_g_o_p_t is a bit field indicating logging options.
-
- Current values for _l_o_g_o_p_t are:
-
- LOG_PID log the process id with each message: useful for
- identifying instantiations of daemons.
-
- LOG_CONS Force writing messages to the console if unable to send it
- to _s_y_s_l_o_g_d. This option is safe to use in daemon processes
- that have no controlling terminal since _s_y_s_l_o_g will fork
- before opening the console.
-
- LOG_ODELAY Delay opening the connection to _s_y_s_l_o_g_d until the first
- _s_y_s_l_o_g call. This is the default.
-
- LOG_NDELAY Open the connection to _s_y_s_l_o_g_d immediately. Useful for
- programs that need to manage the order in which file
- descriptors are allocated.
-
- LOG_NOWAIT Don't wait for children forked to log messages on the
- console. This option should be used by processes that
- enable notification of child termination via SIGCHLD, as
- _s_y_s_l_o_g may otherwise block waiting for a child whose exit
- status has already been collected.
-
- LOG_PERROR Write messages to stderr as well as to _s_y_s_l_o_g_d.
-
- The _f_a_c_i_l_i_t_y parameter encodes a default facility to be assigned to all
- messages that do not have an explicit facility encoded:
-
- LOG_KERN Messages generated by the kernel. These cannot be
- generated by any user processes.
-
- LOG_USER Messages generated by random user processes. This is the
- default facility identifier if none is specified.
-
- LOG_MAIL The mail system.
-
- LOG_DAEMON System daemons, such as _r_o_u_t_e_d(1M), _f_t_p_d(1M), _r_s_h_d(1M),
- etc.
-
- LOG_AUTH The authorization system: _l_o_g_i_n(1), _s_u(1M), _g_e_t_t_y(1M),
- etc. _f_t_p_d(1M), and _r_s_h_d(1M) also use LOG_AUTH.
-
- LOG_LPR The line printer spooling system: _l_p_r(1), _l_p_d(1M), etc.
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- SSSSYYYYSSSSLLLLOOOOGGGG((((3333CCCC)))) SSSSYYYYSSSSLLLLOOOOGGGG((((3333CCCC))))
-
-
-
- LOG_NEWS The network news system.
-
- LOG_UUCP The UNIX-to-UNIX Copy system: _u_u_c_p(1C), _u_u_c_i_c_o(1M),
- _u_u_x(1C), etc.
-
- LOG_LOCAL0 Reserved for local use. Similarly for LOG_LOCAL1 through
- LOG_LOCAL7.
-
- _C_l_o_s_e_l_o_g can be used to close the log file.
-
- _S_e_t_l_o_g_m_a_s_k sets the log priority mask to _m_a_s_k_p_r_i and returns the previous
- mask. Calls to _s_y_s_l_o_g with a priority not set in _m_a_s_k_p_r_i are rejected.
- The mask for an individual priority _p_r_i is calculated by the macro
- LOG_MASK(_p_r_i); the mask for all priorities up to and including _t_o_p_p_r_i is
- given by the macro LOG_UPTO(_t_o_p_p_r_i). The default allows all priorities
- to be logged.
-
-
- CCCCAAAAVVVVEEEEAAAATTTTSSSS
- A call to _o_p_e_n_l_o_g does not make a copy of the _i_d_e_n_t parameter, it merely
- stores a pointer to it. This means that the caller cannot re-use the
- memory in which the string is stored.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
- syslog(LOG_ALERT, "who: internal error 23");
-
- openlog("ftpd", LOG_PID, LOG_DAEMON);
- setlogmask(LOG_UPTO(LOG_ERR));
- syslog(LOG_INFO, "Connection from host %d", CallingHost);
-
- syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m");
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- syslogd(1M)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-